package com.guoxin.concurrentprogramming.chapter4.stream;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Plus());
        Thread t2 = new Thread(new Multiply());
        Thread t3 = new Thread(new Div());
        t1.start();
        t2.start();
        t3.start();

        long begin = System.currentTimeMillis();
        for (int i = 0; i < 1000; i++) {
            for (int j = 0; j < 1000; j++) {
                Msg msg = new Msg();
                msg.i = i;
                msg.j = j;
                msg.orgStr = "(" + i + "+" + j + ")*" + i + "/2";
                Plus.bq.add(msg);
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(end - begin);
    }
}
